package com.example.stream.demostream.service.impl;

import com.example.stream.demostream.entity.SysManager;
import com.example.stream.demostream.mapper.SysManagerMapper;
import com.example.stream.demostream.service.SysManagerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.aop.framework.AopContext;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 平台管理人员表 服务实现类
 * </p>
 *
 * @author chenxiaohua
 * @since 2021-09-30
 */
@Service
public class SysManagerServiceImpl extends ServiceImpl<SysManagerMapper, SysManager> implements SysManagerService {

    @Override
    public List<SysManager> listCustom() {


      return   baseMapper.listCustom();
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void testShiwu() {
        SysManagerServiceImpl proxy = (SysManagerServiceImpl) AopContext.currentProxy();
        proxy.test();
        System.out.println("1111");
        int i=10/0;
//        this.test();
    }

    @Async
    public void test(){
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        SysManager sysManager = new SysManager();
        sysManager.setAddress("11");
        sysManager.setAvatar("22");
        sysManager.setEmail("22");
        sysManager.setIdNumber("111");
        sysManager.setNickname("111");
        sysManager.setOrgCode("111");
        baseMapper.insert(sysManager);
    }
}
